package emergency;

public class StateCompleted extends State {


	/**
	 * Method for cancelling the given emergency
	 * 
	 * @throws IllegalStateException, can't cancel emergency in completed state 
	 */
	@Override
	public void cancel(Emergency e) throws IllegalStateException {
		throw new IllegalStateException("The emergency at place " + e.getLocation().toString() + " is completed, can't cancel");
	}

	/**
	 * Method for competing the given emergency
	 * 
	 * @throws IllegalStateException, can't complete emergency in completed state 
	 */
	@Override
	public void complete(Emergency e) throws IllegalStateException {
		throw new IllegalStateException("The emergency at place " + e.getLocation().toString() + " is already completed");
		
	}

	/**
	 * Method for sending units to the given emergency
	 * 
	 * @throws IllegalStateException, can't send units in completed state 
	 */
	@Override
	public void sendUnits(Emergency e) throws IllegalStateException {
		throw new IllegalStateException("The emergency at place " + e.getLocation().toString() + " is completed, can't send units");
		
	}
	
	/**
	 * Method for getting a string representation of this concrete state
	 * 
	 * @return Returns a string representation of this concrete state
	 */
	@Override
	public String toString() {
		return("statecompleted");
	}

}
